package com.zmj.demo01;

import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;

public class Demo3 {
    public  static  void  main(String[]args) throws  Exception{

        JobDetail jobDetail = JobBuilder.newJob(MyJob.class).
                withIdentity("myJob","myGroup").
                usingJobData("stuName","zmj").build();

        //cron语法： 秒 分 时  天 月  星期 [年]
        CronTrigger cronTrigger= TriggerBuilder.newTrigger()
            .withSchedule(CronScheduleBuilder.cronSchedule("0/5 * 14 17 10 ? 2019")).startNow().build();

        SchedulerFactory schedulerFactory=new StdSchedulerFactory();
        Scheduler scheduler=schedulerFactory.getScheduler();

        scheduler.scheduleJob(jobDetail,cronTrigger);
        scheduler.start();
    }
}
